package com.example.yin.event;

import com.example.yin.service.SongSimilarityCalculatorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class SimilarListener {

    @Autowired
    private SongSimilarityCalculatorService songSimilarityCalculatorService;

    @EventListener
    @Async
    public void historyRecord(UploadMessage event) {
        songSimilarityCalculatorService.caculateSingle(event.getSongId(),event.getTags());
    }


}
